/* ghard13 demo styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fafafa;
    color: #333;
    line-height: 1.4;
    font-size: 14px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.header {
    margin-bottom: 2rem;
    text-align: left;
}

.title {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.25rem;
    color: #000;
    letter-spacing: -0.02em;
}

.subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.nav {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
}

.nav-link {
    padding: 0.5rem 0.75rem;
    background: white;
    border-right: 1px solid #ddd;
    text-decoration: none;
    color: #666;
    font-size: 0.8rem;
    transition: all 0.15s ease;
}

.nav-link:last-child {
    border-right: none;
}

.nav-link:hover {
    background: #f8f8f8;
    color: #333;
}

.nav-link.active {
    background: #000;
    color: white;
}

.main {
    background: white;
    border: 1px solid #ddd;
    padding: 1.5rem;
    border-radius: 3px;
    min-height: 400px;
}

.welcome h2 {
    margin-bottom: 1rem;
    color: #000;
    font-size: 1.1rem;
    font-weight: 400;
}

.welcome p {
    margin-bottom: 2rem;
    color: #666;
    font-size: 0.9rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.feature {
    padding: 1rem;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.feature h3 {
    margin-bottom: 0.5rem;
    color: #000;
    font-size: 0.9rem;
    font-weight: 500;
}

.feature p {
    margin-bottom: 1rem;
    color: #666;
    font-size: 0.8rem;
    line-height: 1.3;
}

.button {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: #000;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.8rem;
    transition: background 0.15s ease;
}

.button:hover {
    background: #333;
}

.demo-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.demo-section h2 {
    margin-bottom: 0.75rem;
    color: #000;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-display, .fallback-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.status-item, .fallback-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.8rem;
}

.status-item label, .fallback-item label {
    font-weight: 500;
    color: #666;
}

.action-buttons, .fallback-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.action-buttons button, .fallback-controls button {
    padding: 0.4rem 0.8rem;
    background: #000;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.15s ease;
}

.action-buttons button:hover, .fallback-controls button:hover {
    background: #333;
}

.config-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.config-item {
    display: flex;
    flex-direction: column;
}

.config-item label {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.config-item input, .config-item select {
    padding: 0.4rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.8rem;
    background: white;
}

#update-config {
    grid-column: 1 / -1;
    padding: 0.5rem 1rem;
    background: #000;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.15s ease;
}

#update-config:hover {
    background: #333;
}

.log-container {
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
}

.log-output {
    height: 150px;
    overflow-y: auto;
    padding: 0.75rem;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.75rem;
    line-height: 1.3;
    background: #f8f8f8;
}

.log-line {
    margin-bottom: 0.2rem;
    color: #333;
}

#clear-log {
    width: 100%;
    padding: 0.4rem;
    background: #666;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.15s ease;
}

#clear-log:hover {
    background: #333;
}

.demo-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
}

.sidebar {
    background: white;
    border: 1px solid #ddd;
    padding: 1rem;
    border-radius: 3px;
}

.demo-main {
    background: white;
    border: 1px solid #ddd;
    padding: 1rem;
    border-radius: 3px;
}

.section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-button {
    display: block;
    width: 100%;
    background: #f8f8f8;
    border: 1px solid #ddd;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    color: #333;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
    border-radius: 3px;
}

.demo-button:hover {
    background: #f0f0f0;
}

.demo-button.active {
    background: #000;
    color: white;
}

.output {
    background: #f8f8f8;
    border: 1px solid #ddd;
    padding: 1rem;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    min-height: 300px;
    white-space: pre-wrap;
    overflow-x: auto;
    border-radius: 3px;
}

.config {
    background: #f8f8f8;
    border: 1px solid #ddd;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 3px;
}

.config label {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.config input {
    width: 100%;
    border: 1px solid #ddd;
    padding: 0.4rem;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 3px;
    background: white;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.4rem;
    margin-top: 1rem;
}

.stat {
    text-align: center;
    padding: 0.5rem;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.stat-value {
    font-size: 1rem;
    font-weight: 500;
    color: #000;
}

.stat-label {
    font-size: 0.65rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.puzzle-ui {
    padding: 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-top: 1rem;
}

.puzzle-instruction {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f8f8;
    border-radius: 3px;
}

.puzzle-instruction p {
    margin: 0.25rem 0;
    font-size: 0.8rem;
    color: #333;
}

.puzzle-timer {
    text-align: center;
    margin-bottom: 1rem;
}

#countdown {
    font-size: 1.2rem;
    font-weight: 500;
    color: #000;
    padding: 0.5rem;
    background: #f8f8f8;
    border-radius: 3px;
    display: inline-block;
    min-width: 100px;
}

.puzzle-controls {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.slider-container, .input-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider-container label, .input-container label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#puzzle-slider {
    width: 100%;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

#puzzle-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #000;
    border-radius: 50%;
    cursor: pointer;
}

#puzzle-input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

#submit-puzzle {
    padding: 0.75rem 1rem;
    background: #000;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.15s ease;
}

#submit-puzzle:hover:not(:disabled) {
    background: #333;
}

#submit-puzzle:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.puzzle-status {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 3px;
    background: #f8f8f8;
}

@media (max-width: 768px) {
    .demo-grid {
        grid-template-columns: 1fr;
    }
    
    .nav {
        flex-wrap: wrap;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .status-display, .fallback-status {
        grid-template-columns: 1fr;
    }
    
    .action-buttons, .fallback-controls {
        flex-direction: column;
    }
    
    .config-controls {
        grid-template-columns: 1fr;
    }
}